package com.knowvoyage.knowvoyageserver.mapper;

import com.knowvoyage.knowvoyageserver.pojo.entity.Learn;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;

@Mapper
public interface LearnMapper {
    void insert(Learn learn);
    Learn selectById(Long learnId);
    List<Learn> selectByUserId(Long userId);
    void delete(Long learnId);
    List<Learn> selectByUserIdAndTimeRange(
            @Param("userId") Long userId,
            @Param("startTime") LocalDateTime startTime,
            @Param("endTime") LocalDateTime endTime
    );
    void update(Learn learn);
    List<Learn> selectAll();

    List<Learn> selectTodayByUserId(@Param("userId") Long userId);
    List<Learn> selectThisWeekByUserId(@Param("userId") Long userId);
}
